package com.oxy.util;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;;

public class LogManager {
	// a reference to Oxy.getCfgManager()
	private ConfigManager oxyCfgRef;
	
	public LogManager(ConfigManager cfg) {
		oxyCfgRef = cfg;
		init();
	}
	private void init() {
		// nothing to init while using commons-logging
		// system properties used:
		// org.apache.commons.logging.log=org.apache.commons.logging.impl.Log4JLogger // specify Log4J as implementation
		// log4j.configuration=logging.properties // specify log4j configuration file
	}
	
	public Log getLogCommon() {
		return LogFactory.getLog(oxyCfgRef.Log().LOG_COMMON);
	}
	
	public Log getLogAccess() {
		return LogFactory.getLog(oxyCfgRef.Log().LOG_ACCESS);
	}
	
	public Log getLog(String name) {
		return LogFactory.getLog(name);
	}
	
	public Log getLog(Class cls) {
		return LogFactory.getLog(cls);
	}
}
